home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 14 / CU Amiga Magazine's Super CD-ROM 14 (1997)(EMAP Images)(GB)(Track 1 of 3)[!][issue 1997-09].iso / CUCD / Programming / GMS / Includes / clib / games_protos.h
Encoding:
C/C++ Source or Header  |  1997-05-04  |  8.7 KB  |  251 lines

  1. #ifndef  CLIB_GAMES_PROTOS_H
  2. #define  CLIB_GAMES_PROTOS_H
  3.  
  4. /*
  5. **   $VER: games_protos.h V0.6B
  6. **
  7. **   C prototypes.
  8. **
  9. **   (C) Copyright 1996-1997 DreamWorld Productions.
  10. **       All Rights Reserved
  11. */
  12.  
  13. #ifndef  GAMES_GMS_H
  14. #include <games/games.h>
  15. #endif
  16.  
  17. #ifndef  EXEC_TYPES_H
  18. #include <exec/types.h>
  19. #endif
  20.  
  21. #ifndef  EXEC_TASKS_H
  22. #include <exec/tasks.h>
  23. #endif
  24.  
  25. /************************************************************************************
  26. ** Standard functions
  27. */
  28.  
  29. ULONG InitGPI(UWORD GPI_ID);
  30. ULONG RemoveGPI(UWORD GPI_ID);
  31. ULONG SetUserPrefs(char *PrefsName);
  32. void  CloseGMS();
  33. ULONG InitTags(APTR Structure, APTR TagList);
  34. struct GMSTask * FindGMSTask();
  35. void  GMSForbid();
  36. void  GMSPermit();
  37.  
  38. void  InitJoyPorts(void);
  39. ULONG ReadMouse(UWORD PortName);
  40. ULONG ReadJoyPort(UWORD PortName, UWORD ReturnType);
  41. ULONG ReadJoyStick(UWORD PortName);
  42. ULONG ReadJoyPad(UWORD PortName);
  43. ULONG ReadSegaPad(UWORD PortName);
  44. ULONG ReadAnalogue(UWORD PortName);
  45. ULONG ReadKey(struct Keys *);
  46. void  WaitLMB(void);
  47. void  WaitTime(UWORD MicroSeconds);
  48.  
  49. ULONG FastRandom(ULONG Range);
  50. ULONG SlowRandom(ULONG Range);
  51. APTR  WriteDec(LONG Number, LONG AmtDigits, char *Destination);
  52. APTR  WriteHex(LONG Number, LONG AmtDigits, char *Destination);
  53.  
  54. void  AddInputHandler(void);
  55. void  RemInputHandler(void);
  56. void  AddInterrupt(APTR Interrupt, UWORD IntNum, UWORD IntPri);
  57. void  RemInterrupt(APTR IntBase);
  58. APTR  AllocMemBlock(ULONG Size, ULONG MemType);
  59. void  FreeMemBlock(APTR MemBlock);
  60. ULONG AddTrack(ULONG Resource, ULONG Data, void *Routine);
  61. void  DeleteTrack(ULONG Key);
  62.  
  63. struct File * OpenFile(char *Filename, ULONG Flags);
  64. ULONG ReadFile(struct File *, APTR Buffer, ULONG Length);
  65. ULONG WriteFile(struct File *, APTR Buffer, ULONG Length);
  66. void  CloseFile(struct File *);
  67.  
  68. APTR  SmartLoad(char *FileName, APTR Destination, ULONG MemType);
  69. APTR  QuickLoad(char *FileName, APTR Destination, ULONG MemType);
  70. APTR  SmartUnpack(APTR Source, APTR Destination, ULONG Password, ULONG MemType);
  71. ULONG SmartSave(char *FileName, APTR Source, APTR SrcLength);
  72.  
  73. APTR  GetPicInfo(APTR PicHeader, struct Picture *);
  74. ULONG UnpackPic(APTR Source, struct Picture *);
  75. struct Picture * LoadPic(struct Picture *);
  76. struct Picture * LoadPicTags(unsigned long tag1, ...);
  77. struct Picture * LoadPicFile(char *Filename, ULONG Options);
  78. void  FreePic(struct Picture *);
  79.  
  80. void InitDestruct(void *DestructCode, APTR DestructStack);
  81. void SelfDestruct(void);
  82. void Armageddon(ULONG Key);
  83. ULONG FingerOfDeath(struct GMSTask *);
  84.  
  85. APTR  GetPicture(void);
  86. APTR  GetStructure(ULONG ID);
  87. APTR  FreeStructure(APTR Structure);
  88.  
  89. APTR  LoadObjectFile(char *Filename);
  90. APTR  GetObject(APTR ObjectBase, char *Name);
  91. APTR  GetObjectList(APTR ObjectBase, APTR);
  92. void  FreeObjectFile(APTR ObjectBase);
  93. APTR  GrabObjectList(APTR ObjectBase);
  94. APTR  CopyOjbect(APTR ObjectBase, char *Name);
  95.  
  96. void  DebugMessage(ULONG Type, char *Text);
  97. void  ErrorMessage(ULONG ErrorCode);
  98. void  StepBack(void);
  99. ULONG DebugActive(void);
  100. void  DebugInactive(void);
  101. ULONG Awaken(struct GMSTask *);
  102.  
  103. /************************************************************************************
  104. ** Screens.GPI functions
  105. */
  106.  
  107. APTR  AllocVideoMem(ULONG Size);
  108. APTR  GetScreen(void);
  109. struct GameScreen * AddScreen(APTR GameScreen);
  110. struct GameScreen * AddScreenTags(ULONG tag1, ...);
  111. void  DeleteScreen(struct GameScreen *);
  112. void  ShowScreen(struct GameScreen *);
  113. APTR  HideScreen(struct GameScreen *);
  114. void  Switch(void);
  115. void  AutoSwitch(void);
  116. void  SwapBuffers(struct GameScreen *);
  117. void  WaitVBL(void);
  118. void  WaitRastLine(WORD LinePosition);
  119. void  RefreshScreen(struct GameScreen *);
  120. void  RemakeScreen(struct GameScreen *);
  121. void  MovePicture(struct GameScreen *);
  122. void  ResetPicture(struct GameScreen *);
  123.  
  124. /* Palette alteration functions */
  125.  
  126. void  UpdatePalette(struct GameScreen *);
  127. UWORD PaletteMorph(struct GameScreen *, UWORD FadeState, UWORD Speed,
  128.   ULONG StartColour, ULONG AmtColours, APTR SrcPalette, APTR DestPalette);
  129. UWORD PaletteToColour(struct GameScreen *, UWORD FadeState, UWORD Speed,
  130.   ULONG StartColour, ULONG AmtColours, APTR Palette, ULONG RRGGBB);
  131. UWORD ColourMorph(struct GameScreen *, UWORD FadeState, UWORD Speed,
  132.   ULONG StartColour, ULONG AmtColours, ULONG SrcColour, ULONG DestColour);
  133. UWORD ColourToPalette(struct GameScreen *, UWORD FadeState, UWORD Speed,
  134.   ULONG StartColour, ULONG AmtColours, APTR Palette, ULONG RRGGBB);
  135. void  ChangeColours(struct GameScreen *, UWORD FadeState, APTR Colours,
  136.   UWORD StartColour, UWORD AmtColours);
  137. void  BlankColours(struct GameScreen *);
  138.  
  139. /* Rasterlist functions */
  140.  
  141. ULONG InitRasterlist(struct GameScreen *);
  142. void  UpdateRasterlist(struct GameScreen *);
  143. void  UpdateRasterCommand(struct GameScreen *, APTR Command);
  144. void  UpdateRasterCommands(struct GameScreen *, APTR Command, UWORD Amount);
  145. void  UpdateRasterLines(struct GameScreen *);
  146. void  RemoveRasterlist(struct GameScreen *);
  147. void  HideRasterlist(struct GameScreen *);
  148. void  ShowRasterlist(struct GameScreen *);
  149.  
  150. /* Sprite functions */
  151.  
  152. struct Sprite * InitSprite(struct GameScreen *, struct Sprite *);
  153. struct Sprite * InitSpriteTags(struct GameScreen *, ULONG tag1Type, ...);
  154. void  UpdateSprite(struct GameScreen *, struct Sprite *);
  155. void  MoveSprite(struct GameScreen *, struct Sprite *);
  156. void  HideSprite(struct GameScreen *, UWORD SpriteNum);
  157. void  UpdateSpriteList(APTR SpriteList);
  158. void  HideSpriteList(APTR SpriteList);
  159. void  RemoveAllSprites(void);
  160. void  ReturnAllSprites(void);
  161. void  FreeSprite(struct Sprite *);
  162.  
  163. void  UpdateColour(struct GameScreen *, ULONG Colour, ULONG Value);
  164. void  BlankOn(void);
  165. void  BlankOff(void);
  166. ULONG MoveToFront(struct GameScreen *);
  167. ULONG MoveToBack(struct GameScreen *);
  168. ULONG TakeDisplay(struct GameScreen *);
  169. struct GameScreen * ReturnDisplay(void);
  170.  
  171. void  FreeVideoMem(APTR MemBlock);
  172. APTR  GetSprite(void);
  173.  
  174. /************************************************************************************
  175. ** Blitter.GPI functions.
  176. */
  177.  
  178. APTR  AllocBlitMem(ULONG Size);
  179. APTR  GetBob(void);
  180. APTR  GetMBob(void);
  181. ULONG AllocBlitter(void);
  182. void  FreeBlitter(void);
  183. APTR  InitBob(struct GameScreen *, APTR Bob);
  184. APTR  InitBobTags(struct GameScreen *Screen, ULONG tag1Type, ...);
  185. APTR  InitBobTagList(struct GameScreen *Screen, struct TagItem *tagList);
  186. void  FreeBob(APTR Bob);
  187. void  DrawBob(struct GameScreen *, APTR Bob, UWORD Buffer, struct Restorelist *);
  188. void  DrawBobList(struct GameScreen *, LONG *BobList[], UWORD Buffer, struct Restorelist *);
  189. void  ClearBob(struct GameScreen *, APTR Bob, UWORD Buffer);
  190. void  DrawLine(struct GameScreen *, UWORD Buffer, WORD StartX,
  191.         WORD StartY, WORD EndX, WORD EndY, ULONG Colour);
  192. void  DrawUCLine(struct GameScreen *, UWORD Buffer, UWORD StartX,
  193.         UWORD StartY, UWORD EndX, UWORD EndY, ULONG Colour);
  194.  
  195. void  CopyBuffer(struct GameScreen *, UWORD SrcBuffer, UWORD DestBuffer);
  196. void  ClrScreen(struct GameScreen *, UWORD Buffer);
  197. void  ClrArea(struct GameScreen *, UWORD StartX, UWORD StartY, UWORD EndX, UWORD EndY);
  198.  
  199. struct Restorelist * InitRestore(ULONG AmtBuffers, ULONG Entries);
  200. void  FreeRestore(struct Restorelist *);
  201. void  ResetRestore(struct Restorelist *);
  202. void  Restore(struct GameScreen *, struct Restorelist *);
  203. void  CleanUpRestore(struct GameScreen *, struct Restorelist *);
  204.  
  205. ULONG InitMap(struct GameScreen *, struct Map *);
  206. void  DrawMap(struct GameScreen *, struct Map *);
  207. void  DrawMapRow(struct GameScreen *, struct Map *);
  208. void  FreeMap(struct Map *);
  209. void  DrawMapTile(struct GameScreen *, struct Map *, WORD XCoord, WORD YCoord);
  210.  
  211. void  DrawPixel(struct GameScreen *, UWORD Buffer, WORD XCoord, WORD YCoord, ULONG Colour);
  212. void  DrawUCPixel(struct GameScreen *, UWORD Buffer, WORD XCoord, WORD YCoord, ULONG Colour);
  213. void  DrawPixelList(struct GameScreen *, UWORD Buffer, struct PixelList *);
  214. void  DrawUCPixelList(struct GameScreen *, UWORD Buffer, struct PixelList *);
  215. ULONG ReadPixel(struct GameScreen *, UWORD Buffer, WORD XCoord, WORD YCoord);
  216. void  ReadPixelList(struct GameScreen *, UWORD Buffer, struct PixelLIst *);
  217.  
  218. void  FreeBlitMem(APTR MemBlock);
  219.  
  220. /************************************************************************************
  221. ** Sound.GPI functions
  222. */
  223.  
  224. ULONG AllocAudio(void);
  225. void  FreeAudio(void);
  226. ULONG InitSound(APTR Sound);
  227. void  FreeSound(APTR Sound);
  228. UWORD CheckChannel(UWORD ChannelName);
  229.  
  230. void  PlaySound(APTR Sound);
  231. void  PlaySoundDAC1(APTR Sound);
  232. void  PlaySoundDAC2(APTR Sound);
  233. void  PlaySoundDAC3(APTR Sound);
  234. void  PlaySoundDAC4(APTR Sound);
  235. void  PlaySoundPri(APTR Sound);
  236. void  PlaySoundPriDAC1(APTR Sound);
  237. void  PlaySoundPriDAC2(APTR Sound);
  238. void  PlaySoundPriDAC3(APTR Sound);
  239. void  PlaySoundPriDAC4(APTR Sound);
  240.  
  241. void  SetVolume(UWORD Channel, UWORD Volume);
  242. void  FadeVolume(UWORD Channel);
  243. void  StopSound(struct Sound *);
  244. void  StopChannel(UWORD Channel);
  245.  
  246. APTR  AllocSoundMem(ULONG Size);
  247. APTR  GetSound(void);
  248. void  FreeSoundMem(APTR Memblock);
  249.  
  250. #endif /* CLIB_GAMES_PROTOS_H */
  251.